package main

import (
	"github.com/pebbe/zmq4"
	"log"
	"time"
)

func main() {
	log.SetFlags(log.Lshortfile)
	context, err := zmq4.NewContext()
	if err != nil {
		log.Println(err)
	}
	responder, err := context.NewSocket(zmq4.REQ)
	if err != nil {
		log.Println(err)
	}
	err = responder.Connect("tcp://127.0.0.1:5555")
	if err != nil {
		log.Println(err)
	}
	for {
		_, err = responder.SendMessage("i send")
		if err != nil {
			log.Println(err)
		}
		request, err := responder.RecvMessage(zmq4.SNDMORE)
		if err != nil {
			log.Println(err)
		}
		log.Println("redv", request)
		time.Sleep(time.Second)
	}
}
